import React, { useState } from "react";
let isInit = false;
const IfSelect = (props) => {
  if (!isInit) {
    const [name, setName] = useState("name");
    isInit = true;
  }
  const [firstName, setFirstName] = useState("yang");
  const [secondeName, setSecondeName] = useState("kingda");
  //debugger;
  return (
    <div className="container">
      <p>firstName:{firstName}</p>
      <p>secondName:{secondeName}</p>
      <p>
        <button
          onClick={() => {
            setFirstName("wang");
          }}
        >
          setFirstName
        </button>
      </p>
      <p>
        <button
          onClick={() => {
            setSecondeName("zongwei");
          }}
        >
          setSecondName
        </button>
      </p>
    </div>
  );
};
export default IfSelect;
